package com.hidtechs.iconifiedList;



import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class IconifiedTextView extends LinearLayout {
     
     private TextView mText,mText1,mText2;
     private ImageView mIcon;
     private CheckBox checkBox;
     public IconifiedTextView(Context context, IconifiedText aIconifiedText) {
          super(context);

          /* First Icon and the Text to the right (horizontal),
           * not above and below (vertical) */
          this.setOrientation(HORIZONTAL);

          checkBox = new CheckBox(context);
          checkBox.setWidth(50);
          addView(checkBox, new LinearLayout.LayoutParams(
                  LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        
          
          mIcon = new ImageView(context);
          mIcon.setImageDrawable(aIconifiedText.getIcon());
          // left, top, right, bottom
          mIcon.setPadding(5, 2, 10, 2); // 5px to the right
          
          /* At first, add the Icon to ourself
           * (! we are extending LinearLayout) */
          addView(mIcon,  new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          
          
          /*mText = new TextView(context);
          mText.setText(aIconifiedText.getText());
          mText.setWidth(100);
           Now the text (after the icon) 
          addView(mText, new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          */
          
          mText1 = new TextView(context);
          mText1.setText("IEESH");
          mText1.setWidth(100);
          mText1.setTextColor(Color.BLACK);
          /* Now the text (after the icon) */
          addView(mText1, new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          
          mText2 = new TextView(context);
          mText2.setText("udeep");
          mText2.setWidth(100);
          mText2.setTextColor(Color.BLACK);
          /* Now the text (after the icon) */
          addView(mText2, new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          
     }

     public void setText(String words) {
          mText.setText(words);
     }
     
     public void setIcon(Drawable bullet) {
          mIcon.setImageDrawable(bullet);
     }
}

